unit uEnvironment;

interface
uses forms,Classes,SysUtils,IniFiles;
type
  TEnvironment = class(TPersistent)
  private
    FAppPath: string;
    FConfigName: String;
    Procedure init;
    Function getAppPath:String;
  public
    property AppPath: string read FAppPath write FAppPath;
    property ConfigName: String read FConfigName write FConfigName;

  end;

implementation
uses uConst,uGlobalObject;


{ TEnvironment }

function TEnvironment.getAppPath: String;
begin
{$WARN SYMBOL_PLATFORM OFF}
  Result := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)));
{$WARN SYMBOL_PLATFORM ON}
end;

procedure TEnvironment.init;
begin
  FAppPath := getAppPath ;
  ConfigName := getAppPath + Config;
end;


initialization
  Env := TEnvironment.Create;
  Env.init; 

finalization
  FreeAndNil(Env);

end.
